package information;

import java.util.Comparator;

/**
 * Comparator for comparing locations of two jobs.
 * Supports user story 7
 * @author Christian
 *
 */
public class JobLocationComparator implements Comparator<Job>{
	//@requires the jobs, parks and park names not null and are properly populated
	//@ensures that one job is >, =, or < the other job based on park names
	public int compare(Job j1, Job j2) {
		String location1 = j1.getPark().getMyName().toLowerCase();
		String location2 = j2.getPark().getMyName().toLowerCase();
		return location1.compareTo(location2);
	}
}
